package com.wing.wcabinet.model.response;

import com.wing.product.model.entity.ProductType;
import com.wing.wcabinet.model.entity.WcabCheckedInventoryInout;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.wing.wcabinet.model.entity.WcabCellInventoryInoutDetail;
import java.math.BigDecimal;

/**
 * 售刀柜上货(上货主表无展示)/领取明细VO
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class WcabCellInventoryInoutDetailVO {

    /**
     * ID
     */
    private Long id;

    /**
     * 创建时间
     */
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    private LocalDateTime createTime;

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 上货/领取id
     */
    private Long inoutId;

    /**
     * 柜子id
     */
    private Long cabId;

    /**
     * sku id
     */
    private Long skuId;

    /**
     * 数量
     */
    private Integer quantity;

    /**
     * 重量
     */
    private BigDecimal weight;

    /**
     * 货道id
     */
    private Long spaceId;



    /**
     * sku code
     */
    private String skuCode;

    /**
     * 柜子编码
     */
    private String cabCode;

    /**
     * 当前库存
     */
    private Integer quantityCurrent;

    /**
     * 变动后库存
     */
    private Integer quantityAfter;

    /**
     * 货道/货位id
     */
    private String spaceCode;

    /**
     * 是否已同步：no(0,未同步);yes(1,已同步);
     */
    private Integer isSyns;

    /**
     * 同步时间
     */
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    private LocalDateTime synsTime;

    /**
     * enterpriseId
     */
    private Long enterpriseId;

    /**
     * enterpriseCode
     */
    private String enterpriseCode;

    private BigDecimal weightCurrent;

    private BigDecimal weightAfter;

    //

    /**
     * 产品sku名称
     */
    private String skuName;


    /**
     * 产品规格
     */
    private String skuSpec;



    /**
     * sku 图片
     */
    private String skuPic;

    /**
     * 产品名称
     */
    private String productName;

    /**
     * 产品类型名称
     */
    private String productTypeName;

    /**
     * 产品分类名称
     */
    private String productCategoryName;

    /**
     * 产品品牌
     */
    private String productBrandName;

    /**
     * 产品型号
     */
    private String productModelName;

    /**
     * 适配机床
     */
    private String deviceName;

    /**
     * 单价
     */
    private BigDecimal price;

    /**
     * 市场价
     */
    private BigDecimal marketPrice;



    /**
     * 总价
     */
    private BigDecimal total;

    /**
     * 最大上货数
     */
    private Integer quantityMax;

    /**
     * 单位
     */
    private String unitName;


    /**
     * 检查结果id
     */
    private Long checkedResultId;

    /**
     * 仓库名字
     */
    private String workshopName;

    /**
     * 楼层
     */
    private String floor;


    /**
     * 刀柜名称
     */
    private String cabName;

    /**
     * 车间位置
     */
    private String workshopLocation;

    /**
     * 企业名称
     */
    private String enterpriseName;

    /**
     * 编码
     */
    private String code;

    /**
     * 订单提交时间
     */
    private LocalDateTime preparationTime;

    /**
     * 出货时间
     */
    private LocalDateTime departureTime;

    /**
     * 订单状态
     */
    private Integer statusDelivery;

    /**
     * 领取操作员
     */
    private String signer;

    private String skuSpecOld;

    private String skuCodeOld;

    /**
     * operationTypeChecked
     */
    private Integer operationTypeChecked;

    /**
     * quantityAfterChecked
     */
    private Integer quantityAfterChecked;

    /**
     * repairPrice
     */
    private BigDecimal repairPrice;

    /**
     * 签收数量
     */
    private Integer quantitySign;


    /**
     * 操作类型描述
     */
    @TableField(exist = false)
    private String operationTypeDesc;

    public String getOperationTypeDesc() {
        return operationType == null ? null : operationType.getDesc();
    }


    /**
     * 业务类型描述
     */
    @TableField(exist = false)
    private String businessTypeDesc;

    public String getBusinessTypeDesc() {
        return businessType == null ? null : businessType.getDesc();
    }

    /**
     * quantityChecked
     */
    private Integer quantityChecked;

    /**
     * 操作类型
     */
    private WcabCellInventoryInoutDetail.OperationType operationType;
    /**
     * 业务类型
     */
    private WcabCellInventoryInoutDetail.BusinessType businessType;

    private WcabCellInventoryInoutDetail.BusinessTypeChecked businessTypeChecked;


    private BigDecimal baseWeight;

    private String weightUnitName;

    private ProductType.WeightUnit weightUnit;


    public String getWeightUnitName(){
        if (this.weightUnit!=null){
            return this.weightUnit.getDesc();
        }
        return "";
    }

    private BigDecimal weightChecked;

    private String weightUnitDesc;

    public String getWeightUnitDesc(){
        if (this.weightUnit!=null){
            return this.weightUnit.getDesc();
        }
        return "";
    }

    private String quantityUnitDesc;

    public String getQuantityUnitDesc(){
        return this.unitName;
    }



}
